// All of the Node.js APIs are available in the preload process.
// It has the same sandbox as a Chrome extension.
window.addEventListener('DOMContentLoaded', () => {
  const replaceText = (selector, text) => {
    const element = document.getElementById(selector)
    if (element) element.innerText = text
  } 
  
  for (const type of ['chrome', 'node', 'electron']) {
    replaceText(`${type}-version`, process.versions[type])
  }
})


const ipc = require('electron').ipcRenderer
const contextMenuBtn = document.getElementById('context-menu')
window.addEventListener('mousedown', function (event) {
	if(event.button == 2){
		event.preventDefault();
    	event.stopPropagation();
		ipc.send('show-context-menu');
    return false;
	}
  
})